/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.zeke.pizzastore.negocio.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author taller
 */
@Embeddable
public class CompraIngredientePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ID_COMPRA")
    private long idCompra;
    @Basic(optional = false)
    @Column(name = "ID_INGREDIENTE")
    private long idIngrediente;

    public CompraIngredientePK() {
    }

    public CompraIngredientePK(long idCompra, long idIngrediente) {
        this.idCompra = idCompra;
        this.idIngrediente = idIngrediente;
    }

    public long getIdCompra() {
        return idCompra;
    }

    public void setIdCompra(long idCompra) {
        this.idCompra = idCompra;
    }

    public long getIdIngrediente() {
        return idIngrediente;
    }

    public void setIdIngrediente(long idIngrediente) {
        this.idIngrediente = idIngrediente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idCompra;
        hash += (int) idIngrediente;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompraIngredientePK)) {
            return false;
        }
        CompraIngredientePK other = (CompraIngredientePK) object;
        if (this.idCompra != other.idCompra) {
            return false;
        }
        if (this.idIngrediente != other.idIngrediente) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.zeke.pizzastore.negocio.entities.CompraIngredientePK[ idCompra=" + idCompra + ", idIngrediente=" + idIngrediente + " ]";
    }
    
}
